var express = require('express');
var router = express.Router();

const yidianlingModel = require("../models/classdetail");
const diquModel = require("../models/diqu");
const indexdataModel = require("../models/indexdata");
const firdetailModel = require("../models/firdetail");
const secdetailModel = require("../models/secdetail");
const thrdetailModel = require("../models/thrdetail");

/* GET users listing. */
router.get('/classdetail', function(req, res, next) {
  yidianlingModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});


router.get('/indexdata', function(req, res, next) {
  indexdataModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});

router.get('/diqu', function(req, res, next) {
  diquModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});

router.get('/firdetail', function(req, res, next) {
  firdetailModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});

router.get('/secdetail', function(req, res, next) {
  secdetailModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});

router.get('/thrdetail', function(req, res, next) {
  thrdetailModel.find({},(err,doc) => {
    if(err) throw err;
    res.json({
      status:0,
      result:doc
    })
  })
});
module.exports = router;
